﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using SqlSugar;

namespace Aioms.Models
{
    ///<summary>
    ///
    ///</summary>
    [SugarTable("task_plan")]
    public class TaskPlan
    {
        public TaskPlan()
        {
            this.Created = DateTime.Now;
            this.Updated = DateTime.Now;
        }
        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:False
        /// </summary>           
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id")]
        [JsonProperty("id")]
        public int Id { get; set; }

        /// <summary>
        /// Desc:企业Id
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "eid")]
        [JsonProperty("eid")]
        public long Eid { get; set; }

        /// <summary>
        /// Desc:计划名称
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "name")]
        [JsonProperty("name")]
        public string Name { get; set; }

        /// <summary>
        /// Desc:计划类型
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "type")]
        [JsonProperty("type")]
        public string Type { get; set; }

        /// <summary>
        /// 来源
        /// </summary>           
        [SugarColumn(ColumnName = "source")]
        [JsonProperty("source")]
        public string Source { get; set; }

        /// <summary>
        /// 引用来源ID
        /// </summary>           
        [SugarColumn(ColumnName = "refids")]
        [JsonProperty("refids")]
        public string RefIds { get; set; }

        /// <summary>
        /// Desc:员工id
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "epids")]
        [JsonProperty("epids")]
        public string Epids { get; set; }

        /// <summary>
        /// Desc:计划周期
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "period")]
        [JsonProperty("period")]
        public string Period { get; set; }

        /// <summary>
        /// Desc:周期日
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "period_day")]
        [JsonProperty("period_day")]
        public string PeriodDay { get; set; }

        /// <summary>
        /// Desc:开始日期
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "begin_date")]
        [JsonProperty("begin_date")]
        public DateTime BeginDate { get; set; }

        /// <summary>
        /// Desc:开始时间
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "begin_time")]
        [JsonProperty("begin_time")]
        public string BeginTime { get; set; }

        /// <summary>
        /// Desc:结束时间
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "end_time")]
        [JsonProperty("end_time")]
        public string EndTime { get; set; }

        /// <summary>
        /// Desc:终止时间
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "status")]
        [JsonProperty("status")]
        public string Status { get; set; }

        /// <summary>
        /// Desc:工时
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "man_hour")]
        [JsonProperty("man_hour")]
        public int ManHour { get; set; }

        /// <summary>
        /// Desc:是否按顺序
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "rank")]
        [JsonProperty("rank")]
        public string Rank { get; set; }

        /// <summary>
        /// Desc:描述
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "description")]
        [JsonProperty("description")]
        public string Description { get; set; }

        /// <summary>
        /// 是否被删除 1-是 0-否
        /// </summary>
        [SugarColumn(ColumnName = "isdel")]
        [JsonProperty("isdel")]
        public int IsDel { get; set; } = 0;

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "created")]
        [JsonProperty("created")]
        public DateTime? Created { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        [SugarColumn(ColumnName = "updated")]
        [JsonProperty("updated")]
        public DateTime? Updated { get; set; }

        /// <summary>
        /// 路线
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [JsonProperty("inspectionline")]
        public InspectionLine InspectionLine { get; set; }

        /// <summary>
        /// 路线
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        [JsonProperty("devices")]
        public List<Device> Devices { get; set; }
    }
}
